package com.shop.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.Exception.CategoryException;
import com.shop.entity.Category;

import java.util.List;

public interface CategoryService {

    int add(Category category);

    Category findById(int id);

    void update(Category category);

    void delete(Integer id);

    Category selectByname(String cat_name);

    /**
     * 查询当前的level的分类集合
     * @param type
     * @return
     */
    public List<Category> getListCategory(Integer type) throws CategoryException;

    /**
     * 分页查询当前level的page
     * @param type
     * @param pagenum
     * @param pagesize
     * @return
     */
    public Page<Category> getPageCategory(Integer type,Integer pagenum,Integer pagesize) throws CategoryException;
}
